package com.example.doctor.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.example.doctor.FavouriteFragment;
import com.example.doctor.FrequentlyFragment;
import com.example.doctor.HomeFragment;
import com.example.doctor.HospitalFragment;

public class TabsPagerAdapter extends FragmentPagerAdapter {

	public TabsPagerAdapter(FragmentManager fm) {
		super(fm);
	}

	@Override
	public Fragment getItem(int index) {
		Fragment f= new Fragment();
		switch (index) {
		case 0:
			f=new HomeFragment();
			break;
			//return new HomeFragment();
			
		case 1:
			f= new FavouriteFragment();
			break;
			//return new FavouriteFragment();

		case 2:
			f=new FrequentlyFragment();
			break;
			//return new FrequentlyFragment();
			
		case 3:
			f=new HospitalFragment();
			break;
			//return new HospitalFragment();

		}

		return f;
	}

	@Override
	public int getCount() {
		// get item count - equal to number of tabs
		return 4;
	}

}
